<?php

namespace app\api\model;

use think\Model;

class Member extends Model
{
    public static function register($mobile, $password, $nickname)
    {
        $data = self::where('member_mobile', '=', $mobile)->find();
        if (!empty($data)) return false;
        $data = array();
        $data['member_mobile'] = $mobile;
        $data['member_password'] = md5($password);
        $data['member_nickname'] = $nickname;
        $data['member_avatar'] = 'default.png';
        $data['member_gender'] = 1;
        $data['add_time'] = time();
        self::insert($data);
        return true;
    }
}
